﻿jQuery(function ($) {


    var s = "1234567890abcdeghijklmAJKDJLjkdjdkADFfaJKDLAPL";

    var getCode = function () {
        var c = "";
        for (var i = 0; i < 5; i++) {
            c += s.charAt(Math.floor(Math.random() * s.length));
        }
        return c;
    };
    var buildUrl = function () {
        var c = getCode();
        $('#validImg').attr('src', "handler/ValidateCodeHandler.ashx?c=" + c + "&t=" + new Date());
        $('#hidValidCode').val(c.toLocaleLowerCase());        
    };
    $("div.updatecode").click(buildUrl);   
    $('.VCode').focus(function () { $('.remark-errcode').hide(); });
    buildUrl();
    $(".foregetpass").click(function () {
        $(".divDialog").dialog(
        {
            title: "找回密码",
            height: 100,
            modal: true,
            draggable: true
        }).find(".dialogbtnsure").click(function () {
            var email = $("#txtEmail").val(); if (email != "")
            { $.post("passHandler.ashx?e=" + email, function (data) { alert(data) }); } else { alert("请输入邮箱信息！"); } 
        });
    });
});